import { getResPath } from '@/utils/cimup';

export default (layer: any) => {
  const { Cesium } = window;
  const { positions } = layer;
  const createShape = (radius: number, segment = 360) => {
    const positions = [];
    for (let i = 0; i < segment; i++) {
      const radians = Cesium.Math.toRadians((i / segment) * 360);
      positions.push([radius * Math.cos(radians), radius * Math.sin(radians)]);
    }
    return positions;
  };

  return {
    data: {
      segment: 10, // 细分数
      cornerDistance: 50, // 拐角距离
      speed: 0.1, // 运动速度
      shapes: createShape(20, 20),
      shape: 'circular',
      imageUrl: getResPath('comm/images/h5a4dlxh.qzv.png'),
      imageScale: 1,
      points: [positions],
    },
  };
};
